package com.valuegroup.smarttodo.data.service;

import com.valuegroup.smarttodo.data.DBMaster;
import com.valuegroup.smarttodo.data.model.*;

import java.util.List;

public class BaseService {

    private EventDao eventDao = DBMaster.getDoaSessionEncryption().getEventDao();
    private HabitDao habitDao = DBMaster.getDoaSessionEncryption().getHabitDao();
    private HabitEventDao habitEventDao = DBMaster.getDoaSessionEncryption().getHabitEventDao();
    private HabitOrderDao habitOrderDao = DBMaster.getDoaSessionEncryption().getHabitOrderDao();
    private HabitOrderRelateDao habitOrderRelateDao = DBMaster.getDoaSessionEncryption().getHabitOrderRelateDao();
    private IdealityDao idealityDao = DBMaster.getDoaSessionEncryption().getIdealityDao();
    private IdealityGrowHisDao idealityGrowHisDao = DBMaster.getDoaSessionEncryption().getIdealityGrowHisDao();
    private IdealityStageDao idealityStageDao = DBMaster.getDoaSessionEncryption().getIdealityStageDao();
    private RemarkDao remarkDao = DBMaster.getDoaSessionEncryption().getRemarkDao();
    private SearchHisDao searchHisDao = DBMaster.getDoaSessionEncryption().getSearchHisDao();
    private TagDao tagDao = DBMaster.getDoaSessionEncryption().getTagDao();
    private TaskDao taskDao = DBMaster.getDoaSessionEncryption().getTaskDao();
    private TaskStepDao taskStepDao = DBMaster.getDoaSessionEncryption().getTaskStepDao();
    private GoalsDao goalsDao = DBMaster.getDoaSessionEncryption().getGoalsDao();
    private GoalRelateDao goalRelateDao = DBMaster.getDoaSessionEncryption().getGoalRelateDao();
    private CurriculumDao curriculumDao = DBMaster.getDoaSessionEncryption().getCurriculumDao();
    private RethinkDao rethinkDao = DBMaster.getDoaSessionEncryption().getRethinkDao();
    private SummarizeDao summarizeDao = DBMaster.getDoaSessionEncryption().getSummarizeDao();
    private SumContentDao sumContentDao = DBMaster.getDoaSessionEncryption().getSumContentDao();
    private SumTopicDao sumTopicDao = DBMaster.getDoaSessionEncryption().getSumTopicDao();

    public void clearDBData() {
        eventDao.deleteAll();
        habitDao.deleteAll();
        habitEventDao.deleteAll();
        habitOrderDao.deleteAll();
        habitOrderRelateDao.deleteAll();
        idealityDao.deleteAll();
        idealityGrowHisDao.deleteAll();
        idealityStageDao.deleteAll();
        remarkDao.deleteAll();
        searchHisDao.deleteAll();
        tagDao.deleteAll();
        taskDao.deleteAll();
        taskStepDao.deleteAll();
        goalsDao.deleteAll();
        goalRelateDao.deleteAll();
        curriculumDao.deleteAll();
        rethinkDao.deleteAll();
        summarizeDao.deleteAll();
        sumContentDao.deleteAll();
        sumTopicDao.deleteAll();
    }

    private final String[] modelArr = new String[]{
            "Event",
            "Habit",
            "HabitEvent",
            "HabitOrder",
            "HabitOrderRelate",
            "Ideality",
            "IdealityGrowHis",
            "IdealityStage",
            "Remark",
            "SearchHis",
            "Tag",
            "Task",
            "TaskStep",
            "Goals",
            "GoalRelate",
            "Curriculum",
            "Rethink",
            "SumContent",
            "Summarize",
            "SumTopic"
    };

    public void backupData() {
        List<Event> eventList = eventDao.loadAll();
        List<Habit> habitList = habitDao.loadAll();
        List<HabitEvent> habitEventList = habitEventDao.loadAll();
        List<HabitOrder> habitOrderList = habitOrderDao.loadAll();
        List<HabitOrderRelate> habitOrderRelateList = habitOrderRelateDao.loadAll();
        List<Ideality> idealityList = idealityDao.loadAll();
        List<IdealityGrowHis> idealityGrowHisList = idealityGrowHisDao.loadAll();
        List<IdealityStage> idealityStageList = idealityStageDao.loadAll();
        List<Remark> remarkList = remarkDao.loadAll();
        List<SearchHis> searchHisList = searchHisDao.loadAll();
        List<Tag> tagList = tagDao.loadAll();
        List<Task> taskList = taskDao.loadAll();
        List<TaskStep> taskStepList = taskStepDao.loadAll();
        List<Goals> goalsList = goalsDao.loadAll();
        List<GoalRelate> goalRelateList = goalRelateDao.loadAll();
        List<Curriculum> curriculumList = curriculumDao.loadAll();
        List<Rethink> rethinkList = rethinkDao.loadAll();
        List<SumContent> sumContents = sumContentDao.loadAll();
        List<Summarize> summarizeList = summarizeDao.loadAll();
        List<SumTopic> sumTopicList = sumTopicDao.loadAll();
    }

    public EventDao getEventDao() {
        return eventDao;
    }

    public void setEventDao(EventDao eventDao) {
        this.eventDao = eventDao;
    }

    public HabitDao getHabitDao() {
        return habitDao;
    }

    public void setHabitDao(HabitDao habitDao) {
        this.habitDao = habitDao;
    }

    public HabitEventDao getHabitEventDao() {
        return habitEventDao;
    }

    public void setHabitEventDao(HabitEventDao habitEventDao) {
        this.habitEventDao = habitEventDao;
    }

    public HabitOrderDao getHabitOrderDao() {
        return habitOrderDao;
    }

    public void setHabitOrderDao(HabitOrderDao habitOrderDao) {
        this.habitOrderDao = habitOrderDao;
    }

    public HabitOrderRelateDao getHabitOrderRelateDao() {
        return habitOrderRelateDao;
    }

    public void setHabitOrderRelateDao(HabitOrderRelateDao habitOrderRelateDao) {
        this.habitOrderRelateDao = habitOrderRelateDao;
    }

    public IdealityDao getIdealityDao() {
        return idealityDao;
    }

    public void setIdealityDao(IdealityDao idealityDao) {
        this.idealityDao = idealityDao;
    }

    public IdealityGrowHisDao getIdealityGrowHisDao() {
        return idealityGrowHisDao;
    }

    public void setIdealityGrowHisDao(IdealityGrowHisDao idealityGrowHisDao) {
        this.idealityGrowHisDao = idealityGrowHisDao;
    }

    public IdealityStageDao getIdealityStageDao() {
        return idealityStageDao;
    }

    public void setIdealityStageDao(IdealityStageDao idealityStageDao) {
        this.idealityStageDao = idealityStageDao;
    }

    public RemarkDao getRemarkDao() {
        return remarkDao;
    }

    public void setRemarkDao(RemarkDao remarkDao) {
        this.remarkDao = remarkDao;
    }

    public SearchHisDao getSearchHisDao() {
        return searchHisDao;
    }

    public void setSearchHisDao(SearchHisDao searchHisDao) {
        this.searchHisDao = searchHisDao;
    }

    public TagDao getTagDao() {
        return tagDao;
    }

    public void setTagDao(TagDao tagDao) {
        this.tagDao = tagDao;
    }

    public TaskDao getTaskDao() {
        return taskDao;
    }

    public void setTaskDao(TaskDao taskDao) {
        this.taskDao = taskDao;
    }

    public TaskStepDao getTaskStepDao() {
        return taskStepDao;
    }

    public void setTaskStepDao(TaskStepDao taskStepDao) {
        this.taskStepDao = taskStepDao;
    }

    public GoalsDao getGoalsDao() {
        return goalsDao;
    }

    public void setGoalsDao(GoalsDao goalsDao) {
        this.goalsDao = goalsDao;
    }

    public GoalRelateDao getGoalRelateDao() {
        return goalRelateDao;
    }

    public void setGoalRelateDao(GoalRelateDao goalRelateDao) {
        this.goalRelateDao = goalRelateDao;
    }

    public CurriculumDao getCurriculumDao() {
        return curriculumDao;
    }

    public void setCurriculumDao(CurriculumDao curriculumDao) {
        this.curriculumDao = curriculumDao;
    }

    public RethinkDao getRethinkDao() {
        return rethinkDao;
    }

    public SummarizeDao getSummarizeDao() {
        return summarizeDao;
    }

    public SumContentDao getSumContentDao() {
        return sumContentDao;
    }

    public SumTopicDao getSumTopicDao() {
        return sumTopicDao;
    }
}
